<%
if (session.getAttribute("username") == null) {
	%><jsp:forward page="login.jsp" /><%
}
%>
<%@ page language="java" contentType="text/html; charset=GBK"
	pageEncoding="GBK" import="bean.PollUser, model.PollUserImpl" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK"> 
<link rel="stylesheet" href="style/stylesheet.css" type="text/css" >
<title>dbPoll</title>
</head>

<body>
<div class="bg">
<div class='content'>

<jsp:include page="nav.jsp" />
	<div class= "pagetitle">Welcome back, <%=session.getAttribute("username") %>.</div>
	<div class="entrytitle">
	[temporary page nav]
	<div class="entry">
		<a href="menu.jsp">Chart test (menu.jsp)</a><br/>
		</div>
	</div>
	<%
	String access = session.getAttribute("accessibility").toString();
	int iacc = Integer.parseInt(access);
	System.out.println("iacc is : "+iacc);
	if(iacc == 5){
		System.out.println("sadmin");
		//insert sysAdmin block
		%>
		<jsp:include page="homeBlocks/SystemAdmin.jsp"/>
		<%
	}if(iacc == 4  && iacc != 5){
		System.out.println("padmin");
		//insert pollAdmin block
		%>
		<jsp:include page="homeBlocks/PollAdmin.jsp"/>
		<%
	}if(iacc >= 3 && iacc != 5){
		System.out.println("creator");
		//insert pollCreator block
		%>
	<jsp:include page="homeBlocks/PollCreator.jsp"/>
		<%
	}if(iacc >= 2  && iacc != 5){
		System.out.println("master");
		//insert pollMaster page
		%>
		<jsp:include page="homeBlocks/PollMaster.jsp"/>
		<%
	}if(iacc >=1  && iacc != 5){
		System.out.println("user");
		//insert pollUser block
		%>
		<jsp:include page="homeBlocks/PollUser.jsp"/>
		<%
	}%>
</div>
</div>
</body>
</html>
